package controller;

import com.lyb.domian.User;
import feignclients.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

//订单服务
@RestController
public class OrderController {

    @Autowired
    private UserFeignClient userFeignClient;

                                            // json 格式
    @GetMapping(value = "/order/user/{id}",produces = "application/json")
    public User getUserById(@PathVariable("id")Long id){
        // 通过Feign远程调用用户服务
        return userFeignClient.getUserById(id);
    }
}
